package com.zengqingfa.designpattern.behavior.iterator;

/**
 * @author zengqingfa
 * @className Client
 * @description 客户端
 * @create 2021/8/25 21:57
 */
public class Client {

    public static void main(String[] args) {

        Aggregate<String> list = new ConcreAggregate<>();
        list.add("a");
        list.add("b");
        list.add("c");
        list.add("d");
        list.add("e");
        Iterator<String> iterator = list.iterator();
        /**
         * a
         * b
         * c
         * d
         * e
         */
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}